.class final Lcom/greystripe/sdk/as;
.super Ljava/lang/Object;


# instance fields
.field private a:Lcom/greystripe/sdk/GSFullscreenActivity;

.field private b:I

.field private c:Z

.field private d:Z


# direct methods
.method public constructor <init>()V
    .locals 2

    const/4 v1, 0x0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, -0x1

    iput v0, p0, Lcom/greystripe/sdk/as;->b:I

    iput-boolean v1, p0, Lcom/greystripe/sdk/as;->c:Z

    iput-boolean v1, p0, Lcom/greystripe/sdk/as;->d:Z

    return-void
.end method


# virtual methods
.method final a()V
    .locals 2

    const/4 v1, 0x0

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/greystripe/sdk/as;->a:Lcom/greystripe/sdk/GSFullscreenActivity;

    const/4 v0, -0x1

    iput v0, p0, Lcom/greystripe/sdk/as;->b:I

    iput-boolean v1, p0, Lcom/greystripe/sdk/as;->c:Z

    iput-boolean v1, p0, Lcom/greystripe/sdk/as;->d:Z

    return-void
.end method

.method final a(Lcom/greystripe/sdk/GSFullscreenActivity;)V
    .locals 3

    const-string v0, "setActivity()"

    const/4 v1, 0x0

    new-array v1, v1, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    iput-object p1, p0, Lcom/greystripe/sdk/as;->a:Lcom/greystripe/sdk/GSFullscreenActivity;

    iget-boolean v0, p0, Lcom/greystripe/sdk/as;->c:Z

    if-eqz v0, :cond_0

    invoke-virtual {p0}, Lcom/greystripe/sdk/as;->lockOrientation()V

    :goto_0
    sget-object v0, Lcom/greystripe/sdk/GSFullscreenAd;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    invoke-virtual {v0}, Lcom/greystripe/sdk/GSFullscreenAd;->j()Lcom/greystripe/sdk/aa;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "EventHandler.broadcastEvent(\'orientationchange\', "

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0}, Lcom/greystripe/sdk/as;->getOrientation()I

    move-result v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ");"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/greystripe/sdk/aa;->b(Ljava/lang/String;)V

    return-void

    :cond_0
    iget-object v0, p0, Lcom/greystripe/sdk/as;->a:Lcom/greystripe/sdk/GSFullscreenActivity;

    const/4 v1, 0x2

    invoke-virtual {v0, v1}, Lcom/greystripe/sdk/GSFullscreenActivity;->setRequestedOrientation(I)V

    goto :goto_0
.end method

.method public final close()V
    .locals 3
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    const/4 v2, 0x0

    const-string v0, "FullscreenAdController#close"

    new-array v1, v2, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    iget-object v0, p0, Lcom/greystripe/sdk/as;->a:Lcom/greystripe/sdk/GSFullscreenActivity;

    if-eqz v0, :cond_0

    const-string v0, "Finishing the Activity"

    new-array v1, v2, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    iget-object v0, p0, Lcom/greystripe/sdk/as;->a:Lcom/greystripe/sdk/GSFullscreenActivity;

    invoke-virtual {v0}, Lcom/greystripe/sdk/GSFullscreenActivity;->finish()V

    :cond_0
    return-void
.end method

.method public final getOrientation()I
    .locals 5
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    const/4 v2, 0x1

    const/4 v1, 0x2

    const/4 v3, 0x0

    iget-object v0, p0, Lcom/greystripe/sdk/as;->a:Lcom/greystripe/sdk/GSFullscreenActivity;

    if-eqz v0, :cond_1

    iget v0, p0, Lcom/greystripe/sdk/as;->b:I

    const/4 v4, -0x1

    if-eq v0, v4, :cond_0

    iget v0, p0, Lcom/greystripe/sdk/as;->b:I

    packed-switch v0, :pswitch_data_0

    move v0, v3

    :goto_0
    packed-switch v0, :pswitch_data_1

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "Java: Unknown orientation: "

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    new-array v2, v3, [Ljava/lang/Object;

    invoke-static {v1, v2}, Lcom/greystripe/sdk/bd;->c(Ljava/lang/String;[Ljava/lang/Object;)V

    move v1, v3

    :goto_1
    :pswitch_0
    new-instance v2, Ljava/lang/StringBuilder;

    const-string v4, "Java: getOrientation("

    invoke-direct {v2, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v2, ") returned: "

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    new-array v2, v3, [Ljava/lang/Object;

    invoke-static {v0, v2}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    :goto_2
    return v1

    :pswitch_1
    move v0, v1

    goto :goto_0

    :pswitch_2
    move v0, v2

    goto :goto_0

    :cond_0
    iget-object v0, p0, Lcom/greystripe/sdk/as;->a:Lcom/greystripe/sdk/GSFullscreenActivity;

    invoke-virtual {v0}, Lcom/greystripe/sdk/GSFullscreenActivity;->a()I

    move-result v0

    goto :goto_0

    :pswitch_3
    move v1, v3

    goto :goto_1

    :pswitch_4
    move v1, v2

    goto :goto_1

    :cond_1
    move v1, v3

    goto :goto_2

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_1
        :pswitch_2
    .end packed-switch

    :pswitch_data_1
    .packed-switch 0x0
        :pswitch_3
        :pswitch_0
        :pswitch_4
        :pswitch_0
    .end packed-switch
.end method

.method public final lockOrientation()V
    .locals 2
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    const/4 v1, 0x1

    iput-boolean v1, p0, Lcom/greystripe/sdk/as;->c:Z

    iget-object v0, p0, Lcom/greystripe/sdk/as;->a:Lcom/greystripe/sdk/GSFullscreenActivity;

    if-eqz v0, :cond_0

    iget-boolean v0, p0, Lcom/greystripe/sdk/as;->d:Z

    if-nez v0, :cond_0

    iput-boolean v1, p0, Lcom/greystripe/sdk/as;->d:Z

    iget v0, p0, Lcom/greystripe/sdk/as;->b:I

    const/4 v1, -0x1

    if-eq v0, v1, :cond_1

    iget-object v0, p0, Lcom/greystripe/sdk/as;->a:Lcom/greystripe/sdk/GSFullscreenActivity;

    iget v1, p0, Lcom/greystripe/sdk/as;->b:I

    invoke-virtual {v0, v1}, Lcom/greystripe/sdk/GSFullscreenActivity;->a(I)V

    :cond_0
    :goto_0
    return-void

    :cond_1
    iget-object v0, p0, Lcom/greystripe/sdk/as;->a:Lcom/greystripe/sdk/GSFullscreenActivity;

    invoke-virtual {v0}, Lcom/greystripe/sdk/GSFullscreenActivity;->b()V

    goto :goto_0
.end method

.method public final setOrientation(I)V
    .locals 4
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    const/4 v0, 0x0

    const/4 v1, 0x1

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "fscontroller#setOrientation("

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, ")"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    new-array v3, v0, [Ljava/lang/Object;

    invoke-static {v2, v3}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    if-ne p1, v1, :cond_0

    :goto_0
    iget-object v2, p0, Lcom/greystripe/sdk/as;->a:Lcom/greystripe/sdk/GSFullscreenActivity;

    if-nez v2, :cond_1

    iput v0, p0, Lcom/greystripe/sdk/as;->b:I

    iput-boolean v1, p0, Lcom/greystripe/sdk/as;->c:Z

    :goto_1
    return-void

    :cond_0
    move v0, v1

    goto :goto_0

    :cond_1
    iget-object v1, p0, Lcom/greystripe/sdk/as;->a:Lcom/greystripe/sdk/GSFullscreenActivity;

    invoke-virtual {v1, v0}, Lcom/greystripe/sdk/GSFullscreenActivity;->a(I)V

    goto :goto_1
.end method

.method public final takeScreenshot()V
    .locals 1
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    iget-object v0, p0, Lcom/greystripe/sdk/as;->a:Lcom/greystripe/sdk/GSFullscreenActivity;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/greystripe/sdk/as;->a:Lcom/greystripe/sdk/GSFullscreenActivity;

    invoke-virtual {v0}, Lcom/greystripe/sdk/GSFullscreenActivity;->takeScreenshot()V

    :cond_0
    return-void
.end method
